import java.security.NoSuchAlgorithmException;


public class TickCounterMain {

	/**
	 * @param args
	 */
	public static void main(String[] args) {
		final TickCounter tc;
		try {
			tc = new TickCounter();
			Thread tcThread = new Thread(new Runnable() {
				@Override
				public void run() {
					while (true) {
						tc.nextKey();
					}
				}
			});
			tcThread.setDaemon(true);
			tcThread.start();
			while (true) {
				System.out.println(tc.getCount());
			}
		} catch (NoSuchAlgorithmException e) {
		}
	}

}
